{include file="index/head" /}
<div class="box">
  <div class="box-head">
    <h2><a href="{:url('link')}" class="btn"><i class="icon-plus-square-o"></i> 添加</a> </h2>
    <a href="javascript:history.go(0);" class="btn fr"><i class="icon-refresh"></i> 刷新</a> </div>
  <table class="table">
    <tr>
      <th width="100">ID</th>
      <th width="15%">关键词</th>
      <th>URL</th>
      <th>LOGO</th>
      <th width="200">操作</th>
    </tr>
    {volist name="list" id="vo"}
    <tr>
      <td>{$vo.id}</td>
      <td>{$vo.title}</td>
      <td>{$vo.url}</td>
      <td><img src="{$v.img|default='_AIMG_/noimg.jpg'}" alt="" style="background:#eee;" alt="" width="30" height="30"/></td>
      <td><a href="{:url('link',['id'=>$vo.id])}" class="btn"><i class="icon-edit"></i> 修改</a> <a href="javascript:void(0);" onclick="sycms.del('{:url('dellink',['id'=>$vo.id])}')" class="btn red"><i class="icon-trash-o"></i> 删除</a></td>
    </tr>
    {/volist}
    <tr>
      <td colspan="5"><div class="page">{$page}</div></td>
    </tr>
  </table>
  <div class="form">
    <form method="post" action="{:url('link')}" class="sycmsform" data-type="ajax">
      <input type="hidden" name="id" value="{$v.id}" />
      <ul>
        <li>
          <label>标题：</label>
          <div class="item">
            <input type="text" name="title" value="{$v.title}" datatype="*" nullmsg="请输入标题" class="input"/>
            <span class="tips"></span> </div>
        </li>
        <li>
          <label>URL：</label>
          <div class="item">
            <input type="text" name="url" value="{$v.url}" class="input" datatype="*" nullmsg="请输入URL"/>
          </div>
        </li>
        <li>
          <label>LOGO：</label>
          <div class="item">
            <input type="text" name="img" value="{$v.img}" class="input"/>
            <button type="button" class="button fl" onclick="sycms.showupload(this)" id="image1" at="dg"><i class="icon-plus"></i>上传LOGO</button>
            <div class="clear"></div>
            <div class="input-image">{if $v.img}<img src="{$v.img}" alt="" />{/if}</div>
          </div>
        </li>
        <li>
          <label>&nbsp;</label>
          <div class="item">
            <button type="submit" onclick="" class="button"><i class="icon-check"></i>提交</button>
          </div>
        </li>
      </ul>
    </form>
  </div>
</div>
<script>
sycms.submitform("{:url('link')}");
</script> 
